package com.example.demo.contrllon;

import com.example.demo.util.MuiscUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class MyController {

    @RequestMapping("getMp3")
    public List<Object> getMap3(String name,Integer page){
        System.out.println(page);
        List<Object> mp3 = null;
        try{
            mp3 = MuiscUtil.getMp3(name,page);
        }catch (Exception e){
            System.out.println("关键词未搜索到");
        }
        return mp3;
    }

    @RequestMapping("getUrl")
    public Map<String, Object> getUrl(String hash ,String song){
        Map<String, Object> url = MuiscUtil.getUrl(hash, song);
        return url;
    }

}
